package community.hospital.annotation;

import community.hospital.validation.PhoneValidation;
import org.springframework.core.annotation.AliasFor;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * @Author：ydj
 * @Date：2023/1/16 20:52
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@Inherited
@Documented
@Constraint(validatedBy = PhoneValidation.class)
public @interface IsPhone {
    @AliasFor("message")
    String value() default "手机号码格式不正确";
    @AliasFor("value")
    String message() default "手机号码格式不正确";;
    Class<?>[] groups() default { };
    Class<? extends Payload>[] payload() default { };
}
